import { ref } from "vue";
export default function tablePagination(init) {
  // 被组合式函数封装和管理的状态
  const pagination = ref({
    current: 1,
    total: 0,
    pageSize: 10,
  });

  const tableChange = (page) => {
    pagination.value = { ...page };
    init();
  };

  // 通过返回值暴露所管理的状态
  return { pagination, tableChange };
}
